# !/usr/bin/env python
# coding=utf-8
# @Time    : 2018/8/14 15:43
# @Author  : 6imensiva
# @Site    : https://gitee.com/dimensiva/rpc_dao.git
# @File    : insurance_query_dao.py
# @Software: PyCharm
# @Version: 2.7.5
from . import Session
from sqlalchemy import and_
from py3_utils import my_sqlalchemy
from db.models import TInsuranceQueryList



def add_ins_qry_list(ins_qry):
	return my_sqlalchemy.common_insert(ins_qry, TInsuranceQueryList)


def get_ins_qry_list(user_id):
	return Session().query(TInsuranceQueryList).filter(user_id == user_id).all()


def get_ins_qry_list_Parms(user_id, biz_id):
	return Session().query(TInsuranceQueryList).filter(and_(user_id == user_id),
	                                                   and_(biz_id == biz_id)).all()